package com.cjl.multi_thread.base_control;

public class Joiner extends Thread{
    private Sleeper sleeper;
    public Joiner(String name,Sleeper sleeper){
        super(name);
        this.sleeper = sleeper;
        start();
    }

    @Override
    public void run() {
        System.out.println(getName() + "Joiner.run start");
        try {
            sleeper.join();

        }catch (InterruptedException e){
            System.out.println(" Interrupted");
        }
        System.out.println(getName() + "  join completed");
    }



}
